//
//  LogViewController.m
//  必争医疗
//
//  Created by 毕成 on 14-11-20.
//  Copyright (c) 2014年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "LogViewController.h"

@interface LogViewController ()

@end

@implementation LogViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self.view setBackgroundColor:[UIColor grayColor]];
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"left.png"] style:UIBarButtonItemStyleDone target:self action:@selector(leftAction:)];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"注册" style:UIBarButtonItemStyleDone target:self action:@selector(rightAction:)];
    
    self.navigationController.navigationBar.translucent = NO;
    [self.navigationItem setTitle:@"登录"];
    
    [self creatView];
}

- (void)leftAction:(id)sender
{
    [self.navigationController popToRootViewControllerAnimated:YES];
}

- (void)rightAction:(id)sender
{
    
}

- (void)creatView
{
    UIImageView *logImage = [[[UIImageView alloc] initWithFrame:CGRectMake(150, 0, 75, 75)] autorelease];
    [logImage setBackgroundColor:[UIColor clearColor]];
    [logImage setImage:[UIImage imageNamed:@"登录中"]];
    [self.view addSubview:logImage];
    
    UIView *account = [[[UIView alloc] initWithFrame:CGRectMake(15, logImage.frame.origin.y + logImage.frame.size.height + 30, 345, 40)] autorelease];
    account.layer.borderWidth = 0.5;
    [account setBackgroundColor:[UIColor whiteColor]];
    [self.view addSubview:account];
    UIImageView *telImage = [[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)] autorelease];
    [telImage setImage:[UIImage imageNamed:@"电话号"]];
    [account addSubview:telImage];
    UITextField *telField = [[UITextField alloc] initWithFrame:CGRectMake(telImage.frame.origin.x + telImage.frame.size.width, telImage.frame.origin.y, 305, telImage.frame.size.height)];
    [telField setPlaceholder:@"手机号"];
    [account addSubview:telField];
    UIView *code = [[[UIView alloc] initWithFrame:CGRectMake(account.frame.origin.x, account.frame.origin.y + account.frame.size.height, account.frame.size.width, account.frame.size.height)] autorelease];
    code.layer.borderWidth = 0.5;
    [code setBackgroundColor:[UIColor whiteColor]];
    [self.view addSubview:code];
    UIImageView *numberImage = [[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)] autorelease];
    [numberImage setImage:[UIImage imageNamed:@"登录密码"]];
    [code addSubview:numberImage];
    UITextField *numberField = [[[UITextField alloc] initWithFrame:CGRectMake(numberImage.frame.origin.x + numberImage.frame.size.width, numberImage.frame.origin.y, 305, numberImage.frame.size.height)] autorelease];
    [numberField setPlaceholder:@"密码"];
    [numberField setSecureTextEntry:YES];
    [code addSubview:numberField];
    
    UIButton *logButton = [[[UIButton alloc] initWithFrame:CGRectMake(code.frame.origin.x, code.frame.origin.y + code.frame.size.height + 20, code.frame.size.width, code.frame.size.height)] autorelease];
    [logButton setBackgroundColor:[UIColor greenColor]];
    [logButton setTitle:@"登录" forState:UIControlStateNormal];
    [logButton setTitle:@"登录" forState:UIControlStateHighlighted];
    [logButton addTarget:self action:@selector(logAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:logButton];
    
    UIView *root = [[[UIView alloc] initWithFrame:CGRectMake(0, logButton.frame.origin.y + logButton.frame.size.height + 40, self.view.frame.size.width, 200)] autorelease];
    [root setBackgroundColor:[UIColor whiteColor]];
    [self.view addSubview:root];
    UILabel *head = [[[UILabel alloc] initWithFrame:CGRectMake(0, 0, root.frame.size.width, 20)] autorelease];
    [head setText:@"或使用以下账号登录"];
    head.font = [UIFont fontWithName:nil size:12];
    head.textAlignment = NSTextAlignmentCenter;
    [root addSubview:head];
    //微博登录
    UIImageView *microblogImage = [[[UIImageView alloc] initWithFrame:CGRectMake(30, head.frame.origin.y + head.frame.size.height + 35, 80, 80)] autorelease];
    [microblogImage setImage:[UIImage imageNamed:@"微博"]];
    microblogImage.clipsToBounds = YES;
    microblogImage.layer.cornerRadius = microblogImage.frame.size.width/2;
    [root addSubview:microblogImage];
    UIButton *microblogButton = [[[UIButton alloc] initWithFrame:CGRectMake(microblogImage.frame.origin.x, microblogImage.frame.origin.y, microblogImage.frame.size.width, microblogImage.frame.size.height)] autorelease];
    [microblogButton setBackgroundColor:[UIColor clearColor]];
    [root addSubview:microblogButton];
    //微信登录
    UIImageView *messageImage = [[[UIImageView alloc] initWithFrame:CGRectMake(microblogButton.frame.origin.x + microblogButton.frame.size.width + 35, microblogButton.frame.origin.y, microblogButton.frame.size.width, microblogButton.frame.size.height)] autorelease];
    [messageImage setImage:[UIImage imageNamed:@"微信"]];
    messageImage.clipsToBounds = YES;
    messageImage.layer.cornerRadius = messageImage.frame.size.width/2;
    [root addSubview:messageImage];
    UIButton *messageButton = [[[UIButton alloc] initWithFrame:CGRectMake(messageImage.frame.origin.x, messageImage.frame.origin.y, messageImage.frame.size.width, messageImage.frame.size.height)] autorelease];
    [messageButton setBackgroundColor:[UIColor clearColor]];
    [root addSubview:messageButton];
    //qq登录
    UIImageView *qqImage = [[[UIImageView alloc] initWithFrame:CGRectMake(messageButton.frame.origin.x + messageButton.frame.size.width + 35, messageButton.frame.origin.y, microblogButton.frame.size.width, messageButton.frame.size.height)] autorelease];
    [qqImage setImage:[UIImage imageNamed:@"qq"]];
    qqImage.clipsToBounds = YES;
    qqImage.layer.cornerRadius = qqImage.frame.size.width/2;
    [root addSubview:qqImage];
    UIButton *qqButton = [[[UIButton alloc] initWithFrame:CGRectMake(qqImage.frame.origin.x, qqImage.frame.origin.y, qqImage.frame.size.width, qqImage.frame.size.height)] autorelease];
    [qqButton setBackgroundColor:[UIColor clearColor]];
    [root addSubview:qqButton];
    
}


- (void)logAction:(id)sender
{
    
}







- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
